<?php
/////////////////////////////////////////////////////////////////////////////
// @author lee99 <lee99.com@gmail.com> Sat Mar 15 11:32:05 GMT 2008
//+----------------------------------------------------------
//说明
//+----------------------------------------------------------
/////////////////////////////////////////////////////////////////////////////


class Count_userAction extends PublicAction{

	
	public function index(){
		$this->display();
	}	
	

	public function ajaxlist(){

		$list=D("Count_user");

		$order=!empty($_REQUEST["order"])?$_REQUEST["order"]:$list->getPk(); //排序字段,默认为"Pk"
		$sortd=!empty($_REQUEST["sort"])?$_REQUEST["sort"]:"asc"; //排序顺序,默认为"asc"
		$orderBy=$order." ".$sortd;//组合排序条件

		$feilds='guid,adid,bizid,hatid,id';

        $condition=Array();//搜索的条件
        //$condition['title']=array('like',"a%");//高级搜索过滤

    if(!empty($_REQUEST['searchkey'])){
		//搜索相关
		$searchkey=$_REQUEST["searchkey"];
		$searchtype=!empty($_REQUEST['searchtype'])?$_REQUEST['searchtype']:'OR';//默认的公共搜索条件为OR

		$this->assign("searchkey",$_REQUEST["searchkey"]);//显示关键字
		$this->assign("searchurl",$_SERVER["REQUEST_URI"]);//当前的URL
		$this->assign("searchtype",$_REQUEST["searchtype"]);//当前的搜索类型

        $ser_c=array('like',"%$searchkey%");//公共的过滤条件
        $condition['id']=array(id,$searchtype);//模糊搜索关键字全局过滤
    }

		
		$count= $list->count($condition);//获取分页总数量
		$p= new ajaxpage($count);
		$page=$p->ajaxshow();//显示分页
		$this->assign("page",$page);//显示分页
		$limit=$p->firstRow.",".$p->listRows;//设定分面的大小

		$limit=($limit==",")?'':$limit;//分页的大小

		$list=$list
			->where($condition)
			->field($feilds)
			->order($orderBy)
			->limit($limit)
			->findAll();

		$this->assign("list",$list);

		$this->display();

	}




















	public function view(){
		$result=D("Count_user");
		$list=$result->getById($_GET['id']);
		$this->assign('list',$list);
				$this->assign("id",$list["id"]);
		$this->assign("guid",$list["guid"]);
		$this->assign("adid",$list["adid"]);
		$this->assign("bizid",$list["bizid"]);
		$this->assign("hatid",$list["hatid"]);

		$this->display();
	}






}
?>